package com.googlecode.stew_faces.component;

import javax.faces.component.UIOutput;

public class HeadComponent extends UIOutput {

	public static final String COMPONENT_TYPE = "com.googlecode.stew_faces.components.HeadComponent";
	public static final String COMPONENT_FAMILY = "com.googlecode.stew_faces.components";
	private static final String DEFAULT_RENDERER = "com.googlecode.stew_faces.renderer.HeadRenderer";

	/**
	 * Properties that are tracked by state saving.
	 */
	protected enum PropertyKeys {
		title, shortcutIcon;

		String toString;

		PropertyKeys(String toString) {
			this.toString = toString;
		}

		PropertyKeys() {
		}

		public String toString() {
			return ((this.toString != null) ? this.toString : super.toString());
		}
	}

	public HeadComponent() {
		setRendererType(DEFAULT_RENDERER);
	}

	public String getFamily() {
		return COMPONENT_FAMILY;
	}

	public String getTitle() {
		return (String) getStateHelper().eval(PropertyKeys.title, null);
	}

	public void setTitle(String title) {
		getStateHelper().put(PropertyKeys.title, title);
	}

	public String getShortcutIcon() {
		return (String) getStateHelper().eval(PropertyKeys.shortcutIcon, null);
	}

	public void setShortcutIcon(String shortcutIcon) {
		getStateHelper().put(PropertyKeys.shortcutIcon, shortcutIcon);
	}
}
